package com.czxy.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 首页分类
 * @author Liuyunqin 17674029449@163.com
 * @date 2018/12/19 15:10
 */
@Table(name = "tb_category")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Category {

    /**
     * 分类id
     */
    @Id
    private Integer id;

    /**
     * 分类名称
     */
    @Column(name = "cat_Name")
    private String catName;


    /**
     * 父类id
     */
    @Column(name = "parent_id")
    private Integer parentId;

    /**
     * 子-分类
     */
    @Transient
    private List<Category> children;

}
